package cn.sportvip.exception;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 一般性错误，比如登陆时用户名密码错误，返回的错误信息可以直接显示给用户
 */
public class GeneralException extends RuntimeException {
	
	private static final Logger LOGGER = LoggerFactory.getLogger(GeneralException.class);

	private static final long serialVersionUID = 1L;
	private int errorCode = 200;
	
	public GeneralException(String message) {
		super(message);
	}

	public GeneralException(String message, Exception e) {
		super(message);
		LOGGER.warn(message, e);
	}

	public int getErrorCode() {
		return errorCode;
	}

	public void setErrorCode(int errorCode) {
		this.errorCode = errorCode;
	}
}
